import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/3/28
 * Time:18:32
 **/
public class HelloServlet extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            // 1.获得写入流
        PrintWriter writer = resp.getWriter();
        writer.println("<h1 style='color:red'>Hello,Servlet~</h1>");
    }
}

